#include <iostream>
#include <vector>
using namespace std;

class Program
{
	vector<int> top;
	vector<int> perSquare;

	bool IsPerfectSquare( int x )
	{
		int l = 0, h = perSquare.size();
		while( l < h )
		{
			int m = l + ( h - l ) / 2;
			if( perSquare[m] >= x ) h = m;
			else l = m + 1;
		}
		return perSquare[l] == x;
	}

public:

	Program(): top( 64, 0 )
	{
		int t = 1;
		for( int i = 1; i <= 100; i++ )
		{
			perSquare.push_back( t );
			t += ( 2 * i + 1 );
		}
	}

	int main()
	{	
		int count = 0;
		cin >> count;
		while( count-- )
		{
			int maxc = 0;
			cin >> maxc;
			int c = 0;
			int i = 1;
			while( true )
			{
				bool inserted = false;
				for( int j = 0; j < c; j++ )
				{
					if( IsPerfectSquare( top[j] + i ) )
					{
						top[j] = i++;
						inserted = true;
						break;
					}
				}
				if( !inserted )
				{
					if( c == maxc ) { cout << i - 1 << endl; break; }
					else top[c++] = i++;
				}
			}
		}
		return 0;
	}
};

int main()
{
	return Program().main();
}